package com.iwunu.auth.vo;

import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * jwt用户vo
 * @author kinfeng
 *
 */
public class JwtUserVo implements UserDetails{
	/** 账号ID，主键ID **/
	private Long id;
	/** 账号 **/
	private String username;
	/** 密码 **/
	private String password;
	/** 拥有角色 **/
	private List<JwtRole> authorities;
	/** 账号名称 **/
	private String name;
	/** 账户关闭 **/
	private boolean isAccountNonExpired = true;
	/** 账户锁定 **/
	private boolean isAccountNonLocked = true;
	/** 账户凭证关闭 **/
	private boolean isCredentialsNonExpired = true;
	/** 账户可用 **/
	private boolean isEnabled = true;
	
	public JwtUserVo() {
		super();
	}

	public JwtUserVo(String username, List<JwtRole> authorities) {
		super();
		this.username = username;
		this.authorities = authorities;
	}
	
	public JwtUserVo(String username, String name, List<JwtRole> authorities) {
		super();
		this.username = username;
		this.name = name;
		this.authorities = authorities;
	}
	
	public JwtUserVo(Long id, String username, List<JwtRole> authorities) {
		super();
		this.id = id;
		this.username = username;
		this.authorities = authorities;
	}
	
	public JwtUserVo(Long id, String username, String name, List<JwtRole> authorities) {
		super();
		this.id = id;
		this.username = username;
		this.name = name;
		this.authorities = authorities;
	}
	
	public JwtUserVo(Long id,String username, List<JwtRole> authorities, boolean isEnabled) {
		super();
		this.id = id;
		this.username = username;
		this.authorities = authorities;
		this.isEnabled = isEnabled;
	}
	
	public JwtUserVo(Long id,String username, String name, List<JwtRole> authorities, boolean isEnabled) {
		super();
		this.id = id;
		this.username = username;
		this.name = name;
		this.authorities = authorities;
		this.isEnabled = isEnabled;
	}
	
	public JwtUserVo(Long id, String username, String password, List<JwtRole> authorities, boolean isAccountNonExpired,
			boolean isAccountNonLocked, boolean isCredentialsNonExpired, boolean isEnabled) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.authorities = authorities;
		this.isAccountNonExpired = isAccountNonExpired;
		this.isAccountNonLocked = isAccountNonLocked;
		this.isCredentialsNonExpired = isCredentialsNonExpired;
		this.isEnabled = isEnabled;
	}
	
	public JwtUserVo(Long id, String username, String name, String password, List<JwtRole> authorities, boolean isAccountNonExpired,
			boolean isAccountNonLocked, boolean isCredentialsNonExpired, boolean isEnabled) {
		super();
		this.id = id;
		this.username = username;
		this.name = name;
		this.password = password;
		this.authorities = authorities;
		this.isAccountNonExpired = isAccountNonExpired;
		this.isAccountNonLocked = isAccountNonLocked;
		this.isCredentialsNonExpired = isCredentialsNonExpired;
		this.isEnabled = isEnabled;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public List<JwtRole> getAuthorities() {
		return authorities;
	}

	public void setAuthorities(List<JwtRole> authorities) {
		this.authorities = authorities;
	}

	public boolean isAccountNonExpired() {
		return isAccountNonExpired;
	}

	public void setAccountNonExpired(boolean isAccountNonExpired) {
		this.isAccountNonExpired = isAccountNonExpired;
	}

	public boolean isAccountNonLocked() {
		return isAccountNonLocked;
	}

	public void setAccountNonLocked(boolean isAccountNonLocked) {
		this.isAccountNonLocked = isAccountNonLocked;
	}

	public boolean isCredentialsNonExpired() {
		return isCredentialsNonExpired;
	}

	public void setCredentialsNonExpired(boolean isCredentialsNonExpired) {
		this.isCredentialsNonExpired = isCredentialsNonExpired;
	}

	public boolean isEnabled() {
		return isEnabled;
	}

	public void setEnabled(boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "JwtUserVo [id=" + id + ", username=" + username + ", password=" + password + ", authorities="
				+ authorities + ", name=" + name + ", isAccountNonExpired=" + isAccountNonExpired
				+ ", isAccountNonLocked=" + isAccountNonLocked + ", isCredentialsNonExpired=" + isCredentialsNonExpired
				+ ", isEnabled=" + isEnabled + "]";
	}
 

}
